/*
* @Author: JINPENG
* @Date:   2018-05-28 21:30:32
* @Last Modified by:   JINPENG
* @Last Modified time: 2018-09-06 22:57:06
*/
'use strict';
require('./index.css');
var $j = require('jquery');
require('page/common/nav/index.js');
require('page/common/header/index.js');
require('util/slider/index.js');
var templateBanner  = require('./banner.string');
var _mm             = require('util/mm.js');

$j(function() {
    // 渲染banner的html
    var bannerHtml  = _mm.renderHtml(templateBanner);
    $j('.banner-con').html(bannerHtml);
    // 初始化banner
   var $slider     = $j('.banner').unslider({
        dots: true
    });
    // 前一张和后一张操作的事件绑定
    $j('.banner-con .banner-arrow').click(function(){
        var forward = $j(this).hasClass('prev') ? 'prev' : 'next';
        $slider.data('unslider')[forward]();
    });
});

